//
//  ZhujiaoNetwork.m
//  Shengzhuli
//
//  Created by FXGuo on 2017/12/28.
//  Copyright © 2017年 kamangkeji. All rights reserved.
//

#import "ZhujiaoNetwork.h"
#import "GFXNetworkHandle.h"
#import "TeachListModel.h"
#import "RegistrationListModel.h"

NSString * const ZhujiaoActivityList = @"auth/activity/teachList";//助教管理活动列表
NSString * const RegistrationList = @"auth/activity/registrationList";//签到嘉宾列表

@implementation ZhujiaoNetwork

+ (void)getZhujiaoActivityListWithParame:(NSDictionary *)parames response:(void (^)(BOOL success,NSString *msg,NSArray *lists))response
{
    [[GFXNetworkHandle shareHandle]post:ZhujiaoActivityList params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            NSMutableArray *sources = [NSMutableArray array];
            for (NSDictionary *dict in json[@"result"]) {
                TeachListModel *model = [TeachListModel objectWithDict:dict];
                [sources addObject:model];
            }
            response(YES,json[@"message"],sources);
        }else{
            response(NO,json[@"message"],nil);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError,nil);
    }];
}

+ (void)getRegistrationListWithParame:(NSDictionary *)parames response:(void (^)(BOOL success,NSString *msg,NSArray *lists))response
{
    [[GFXNetworkHandle shareHandle]post:RegistrationList params:parames success:^(id json) {
        if ([json[@"status"] isEqualToString:SuccessStatus]) {
            NSMutableArray *sources = [NSMutableArray array];
            for (NSDictionary *dict in json[@"result"]) {
                RegistrationListModel *model = [RegistrationListModel objectWithDict:dict];
                [sources addObject:model];
            }
            response(YES,json[@"message"],sources);
        }else{
            response(NO,json[@"message"],nil);
        }
    } failure:^(NSError *error) {
        response(NO,NetworkError,nil);
    }];
}

@end
